/*
 * @Author: 周洋 1430536748@qq.com
 * @Date: 2024-08-10 13:31:46
 * @LastEditors: 周洋 1430536748@qq.com
 * @LastEditTime: 2024-08-23 09:41:53
 * @version: 1.2.5
 * @Description: 
 */
import { PropType } from "vue";
import { IFormItems } from '@/types/index.d';
import type { FormRules } from 'element-plus'
const ISize = ['large', 'default','small'] as const;
type ISizeType = (typeof ISize)[number];

const IPosition = ['left', 'right','top'] as const;
type IPositionType = (typeof IPosition)[number];

export const props = {
    /** 表单循环 */
    FormItems: { type: Array<IFormItems>,required: true},
    /** 表单动态数据 */
    data: { type: Object as PropType<any>, required: true},
    /** 校验表单 */
    ruleForm:{ type:Object as PropType<FormRules>,default:null },
    /** 是否显示清除按钮 */
    clearable:{ type:Boolean,default:false},
    /** 标签的长度 */
    labelWidth: {type: String,default: '80px'},
    /** 表单域标签的位置 */
    labelPosition:{ type: String as PropType<IPositionType>,default: 'right'},
    /** 自定义表单class */
    customClass: { type: String, default: ''},
    /** 表单大小 */
    formSize:{ type: String as PropType<ISizeType>,validator: (v: any) => ISize.includes(v), default: 'default'},
};


export interface Emits {
    /** 搜索按钮回调	 */
    (e: 'onSearch',data:any,close:()=>void): () => void;
}